﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using System;


namespace XLua
{
    public partial class ObjectTranslator
    {
        
        class IniterAdderXLuaTestPedding
        {
            static IniterAdderXLuaTestPedding()
            {
                AddIniter(Init);
            }
			
			static void Init(ObjectTranslator translator)
			{
			
				translator.RegisterPushAndGetAndUpdate<XLuaTest.Pedding>(translator.PushXLuaTestPedding, translator.Get, translator.UpdateXLuaTestPedding);
				translator.RegisterPushAndGetAndUpdate<XLuaTest.MyStruct>(translator.PushXLuaTestMyStruct, translator.Get, translator.UpdateXLuaTestMyStruct);
				translator.RegisterPushAndGetAndUpdate<UnityEngine.Vector2>(translator.PushUnityEngineVector2, translator.Get, translator.UpdateUnityEngineVector2);
				translator.RegisterPushAndGetAndUpdate<UnityEngine.Vector3>(translator.PushUnityEngineVector3, translator.Get, translator.UpdateUnityEngineVector3);
				translator.RegisterPushAndGetAndUpdate<UnityEngine.Vector4>(translator.PushUnityEngineVector4, translator.Get, translator.UpdateUnityEngineVector4);
				translator.RegisterPushAndGetAndUpdate<UnityEngine.Color>(translator.PushUnityEngineColor, translator.Get, translator.UpdateUnityEngineColor);
				translator.RegisterPushAndGetAndUpdate<UnityEngine.Quaternion>(translator.PushUnityEngineQuaternion, translator.Get, translator.UpdateUnityEngineQuaternion);
				translator.RegisterPushAndGetAndUpdate<UnityEngine.Ray>(translator.PushUnityEngineRay, translator.Get, translator.UpdateUnityEngineRay);
				translator.RegisterPushAndGetAndUpdate<UnityEngine.Bounds>(translator.PushUnityEngineBounds, translator.Get, translator.UpdateUnityEngineBounds);
				translator.RegisterPushAndGetAndUpdate<UnityEngine.Ray2D>(translator.PushUnityEngineRay2D, translator.Get, translator.UpdateUnityEngineRay2D);
				translator.RegisterPushAndGetAndUpdate<TestStruct>(translator.PushTestStruct, translator.Get, translator.UpdateTestStruct);
				translator.RegisterPushAndGetAndUpdate<StaticPusherStructA>(translator.PushStaticPusherStructA, translator.Get, translator.UpdateStaticPusherStructA);
				translator.RegisterPushAndGetAndUpdate<StaticPusherStructB>(translator.PushStaticPusherStructB, translator.Get, translator.UpdateStaticPusherStructB);
				translator.RegisterPushAndGetAndUpdate<StaticPusherStructAll>(translator.PushStaticPusherStructAll, translator.Get, translator.UpdateStaticPusherStructAll);
				translator.RegisterPushAndGetAndUpdate<Gen2FloatStruct>(translator.PushGen2FloatStruct, translator.Get, translator.UpdateGen2FloatStruct);
				translator.RegisterPushAndGetAndUpdate<Gen3FloatStruct>(translator.PushGen3FloatStruct, translator.Get, translator.UpdateGen3FloatStruct);
				translator.RegisterPushAndGetAndUpdate<Gen4FloatStruct>(translator.PushGen4FloatStruct, translator.Get, translator.UpdateGen4FloatStruct);
				translator.RegisterPushAndGetAndUpdate<Gen5FloatStruct>(translator.PushGen5FloatStruct, translator.Get, translator.UpdateGen5FloatStruct);
				translator.RegisterPushAndGetAndUpdate<Gen6FloatStruct>(translator.PushGen6FloatStruct, translator.Get, translator.UpdateGen6FloatStruct);
				translator.RegisterPushAndGetAndUpdate<TableAutoTransSimpleStruct>(translator.PushTableAutoTransSimpleStruct, translator.Get, translator.UpdateTableAutoTransSimpleStruct);
				translator.RegisterPushAndGetAndUpdate<TableAutoTransComplexStruct>(translator.PushTableAutoTransComplexStruct, translator.Get, translator.UpdateTableAutoTransComplexStruct);
				translator.RegisterPushAndGetAndUpdate<XLuaTest.MyEnum>(translator.PushXLuaTestMyEnum, translator.Get, translator.UpdateXLuaTestMyEnum);
				translator.RegisterPushAndGetAndUpdate<Tutorial.TestEnum>(translator.PushTutorialTestEnum, translator.Get, translator.UpdateTutorialTestEnum);
				translator.RegisterPushAndGetAndUpdate<Tutorial.DrivenClass.TestEnumInner>(translator.PushTutorialDrivenClassTestEnumInner, translator.Get, translator.UpdateTutorialDrivenClassTestEnumInner);
				translator.RegisterPushAndGetAndUpdate<LuaTestType>(translator.PushLuaTestType, translator.Get, translator.UpdateLuaTestType);
				translator.RegisterPushAndGetAndUpdate<FirstPushEnum>(translator.PushFirstPushEnum, translator.Get, translator.UpdateFirstPushEnum);
			
				translator.RegisterCaster<TableAutoTransSimpleClass>(translator.Get);
				translator.RegisterCaster<TableAutoTransComplexClass>(translator.Get);
				translator.RegisterCaster<TestTableAutoTransClass>(translator.Get);
			}
        }
        
        static IniterAdderXLuaTestPedding s_IniterAdderXLuaTestPedding_dumb_obj = new IniterAdderXLuaTestPedding();
        static IniterAdderXLuaTestPedding IniterAdderXLuaTestPedding_dumb_obj {get{return s_IniterAdderXLuaTestPedding_dumb_obj;}}
        
        
        int XLuaTestPedding_TypeID = -1;
        public void PushXLuaTestPedding(RealStatePtr L, XLuaTest.Pedding val)
        {
            if (XLuaTestPedding_TypeID == -1)
            {
			    bool is_first;
                XLuaTestPedding_TypeID = getTypeId(L, typeof(XLuaTest.Pedding), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 1, XLuaTestPedding_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for XLuaTest.Pedding ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out XLuaTest.Pedding val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != XLuaTestPedding_TypeID)
				{
				    throw new Exception("invalid userdata for XLuaTest.Pedding");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for XLuaTest.Pedding");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (XLuaTest.Pedding)objectCasters.GetCaster(typeof(XLuaTest.Pedding))(L, index, null);
            }
        }
		
        public void UpdateXLuaTestPedding(RealStatePtr L, int index, XLuaTest.Pedding val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != XLuaTestPedding_TypeID)
				{
				    throw new Exception("invalid userdata for XLuaTest.Pedding");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for XLuaTest.Pedding ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int XLuaTestMyStruct_TypeID = -1;
        public void PushXLuaTestMyStruct(RealStatePtr L, XLuaTest.MyStruct val)
        {
            if (XLuaTestMyStruct_TypeID == -1)
            {
			    bool is_first;
                XLuaTestMyStruct_TypeID = getTypeId(L, typeof(XLuaTest.MyStruct), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 25, XLuaTestMyStruct_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for XLuaTest.MyStruct ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out XLuaTest.MyStruct val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != XLuaTestMyStruct_TypeID)
				{
				    throw new Exception("invalid userdata for XLuaTest.MyStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for XLuaTest.MyStruct");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (XLuaTest.MyStruct)objectCasters.GetCaster(typeof(XLuaTest.MyStruct))(L, index, null);
            }
        }
		
        public void UpdateXLuaTestMyStruct(RealStatePtr L, int index, XLuaTest.MyStruct val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != XLuaTestMyStruct_TypeID)
				{
				    throw new Exception("invalid userdata for XLuaTest.MyStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for XLuaTest.MyStruct ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int UnityEngineVector2_TypeID = -1;
        public void PushUnityEngineVector2(RealStatePtr L, UnityEngine.Vector2 val)
        {
            if (UnityEngineVector2_TypeID == -1)
            {
			    bool is_first;
                UnityEngineVector2_TypeID = getTypeId(L, typeof(UnityEngine.Vector2), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 8, UnityEngineVector2_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for UnityEngine.Vector2 ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out UnityEngine.Vector2 val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector2_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Vector2");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for UnityEngine.Vector2");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (UnityEngine.Vector2)objectCasters.GetCaster(typeof(UnityEngine.Vector2))(L, index, null);
            }
        }
		
        public void UpdateUnityEngineVector2(RealStatePtr L, int index, UnityEngine.Vector2 val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector2_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Vector2");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for UnityEngine.Vector2 ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int UnityEngineVector3_TypeID = -1;
        public void PushUnityEngineVector3(RealStatePtr L, UnityEngine.Vector3 val)
        {
            if (UnityEngineVector3_TypeID == -1)
            {
			    bool is_first;
                UnityEngineVector3_TypeID = getTypeId(L, typeof(UnityEngine.Vector3), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 12, UnityEngineVector3_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for UnityEngine.Vector3 ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out UnityEngine.Vector3 val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector3_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Vector3");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for UnityEngine.Vector3");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (UnityEngine.Vector3)objectCasters.GetCaster(typeof(UnityEngine.Vector3))(L, index, null);
            }
        }
		
        public void UpdateUnityEngineVector3(RealStatePtr L, int index, UnityEngine.Vector3 val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector3_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Vector3");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for UnityEngine.Vector3 ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int UnityEngineVector4_TypeID = -1;
        public void PushUnityEngineVector4(RealStatePtr L, UnityEngine.Vector4 val)
        {
            if (UnityEngineVector4_TypeID == -1)
            {
			    bool is_first;
                UnityEngineVector4_TypeID = getTypeId(L, typeof(UnityEngine.Vector4), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineVector4_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for UnityEngine.Vector4 ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out UnityEngine.Vector4 val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector4_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Vector4");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for UnityEngine.Vector4");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (UnityEngine.Vector4)objectCasters.GetCaster(typeof(UnityEngine.Vector4))(L, index, null);
            }
        }
		
        public void UpdateUnityEngineVector4(RealStatePtr L, int index, UnityEngine.Vector4 val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector4_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Vector4");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for UnityEngine.Vector4 ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int UnityEngineColor_TypeID = -1;
        public void PushUnityEngineColor(RealStatePtr L, UnityEngine.Color val)
        {
            if (UnityEngineColor_TypeID == -1)
            {
			    bool is_first;
                UnityEngineColor_TypeID = getTypeId(L, typeof(UnityEngine.Color), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineColor_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for UnityEngine.Color ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out UnityEngine.Color val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineColor_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Color");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for UnityEngine.Color");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (UnityEngine.Color)objectCasters.GetCaster(typeof(UnityEngine.Color))(L, index, null);
            }
        }
		
        public void UpdateUnityEngineColor(RealStatePtr L, int index, UnityEngine.Color val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineColor_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Color");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for UnityEngine.Color ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int UnityEngineQuaternion_TypeID = -1;
        public void PushUnityEngineQuaternion(RealStatePtr L, UnityEngine.Quaternion val)
        {
            if (UnityEngineQuaternion_TypeID == -1)
            {
			    bool is_first;
                UnityEngineQuaternion_TypeID = getTypeId(L, typeof(UnityEngine.Quaternion), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineQuaternion_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for UnityEngine.Quaternion ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out UnityEngine.Quaternion val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineQuaternion_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Quaternion");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for UnityEngine.Quaternion");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (UnityEngine.Quaternion)objectCasters.GetCaster(typeof(UnityEngine.Quaternion))(L, index, null);
            }
        }
		
        public void UpdateUnityEngineQuaternion(RealStatePtr L, int index, UnityEngine.Quaternion val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineQuaternion_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Quaternion");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for UnityEngine.Quaternion ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int UnityEngineRay_TypeID = -1;
        public void PushUnityEngineRay(RealStatePtr L, UnityEngine.Ray val)
        {
            if (UnityEngineRay_TypeID == -1)
            {
			    bool is_first;
                UnityEngineRay_TypeID = getTypeId(L, typeof(UnityEngine.Ray), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 24, UnityEngineRay_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for UnityEngine.Ray ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out UnityEngine.Ray val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Ray");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for UnityEngine.Ray");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (UnityEngine.Ray)objectCasters.GetCaster(typeof(UnityEngine.Ray))(L, index, null);
            }
        }
		
        public void UpdateUnityEngineRay(RealStatePtr L, int index, UnityEngine.Ray val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Ray");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for UnityEngine.Ray ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int UnityEngineBounds_TypeID = -1;
        public void PushUnityEngineBounds(RealStatePtr L, UnityEngine.Bounds val)
        {
            if (UnityEngineBounds_TypeID == -1)
            {
			    bool is_first;
                UnityEngineBounds_TypeID = getTypeId(L, typeof(UnityEngine.Bounds), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 24, UnityEngineBounds_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for UnityEngine.Bounds ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out UnityEngine.Bounds val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineBounds_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Bounds");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for UnityEngine.Bounds");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (UnityEngine.Bounds)objectCasters.GetCaster(typeof(UnityEngine.Bounds))(L, index, null);
            }
        }
		
        public void UpdateUnityEngineBounds(RealStatePtr L, int index, UnityEngine.Bounds val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineBounds_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Bounds");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for UnityEngine.Bounds ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int UnityEngineRay2D_TypeID = -1;
        public void PushUnityEngineRay2D(RealStatePtr L, UnityEngine.Ray2D val)
        {
            if (UnityEngineRay2D_TypeID == -1)
            {
			    bool is_first;
                UnityEngineRay2D_TypeID = getTypeId(L, typeof(UnityEngine.Ray2D), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineRay2D_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for UnityEngine.Ray2D ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out UnityEngine.Ray2D val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay2D_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Ray2D");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for UnityEngine.Ray2D");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (UnityEngine.Ray2D)objectCasters.GetCaster(typeof(UnityEngine.Ray2D))(L, index, null);
            }
        }
		
        public void UpdateUnityEngineRay2D(RealStatePtr L, int index, UnityEngine.Ray2D val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay2D_TypeID)
				{
				    throw new Exception("invalid userdata for UnityEngine.Ray2D");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for UnityEngine.Ray2D ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int TestStruct_TypeID = -1;
        public void PushTestStruct(RealStatePtr L, TestStruct val)
        {
            if (TestStruct_TypeID == -1)
            {
			    bool is_first;
                TestStruct_TypeID = getTypeId(L, typeof(TestStruct), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 25, TestStruct_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for TestStruct ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out TestStruct val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != TestStruct_TypeID)
				{
				    throw new Exception("invalid userdata for TestStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for TestStruct");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (TestStruct)objectCasters.GetCaster(typeof(TestStruct))(L, index, null);
            }
        }
		
        public void UpdateTestStruct(RealStatePtr L, int index, TestStruct val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != TestStruct_TypeID)
				{
				    throw new Exception("invalid userdata for TestStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for TestStruct ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int StaticPusherStructA_TypeID = -1;
        public void PushStaticPusherStructA(RealStatePtr L, StaticPusherStructA val)
        {
            if (StaticPusherStructA_TypeID == -1)
            {
			    bool is_first;
                StaticPusherStructA_TypeID = getTypeId(L, typeof(StaticPusherStructA), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 2, StaticPusherStructA_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for StaticPusherStructA ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out StaticPusherStructA val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != StaticPusherStructA_TypeID)
				{
				    throw new Exception("invalid userdata for StaticPusherStructA");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for StaticPusherStructA");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (StaticPusherStructA)objectCasters.GetCaster(typeof(StaticPusherStructA))(L, index, null);
            }
        }
		
        public void UpdateStaticPusherStructA(RealStatePtr L, int index, StaticPusherStructA val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != StaticPusherStructA_TypeID)
				{
				    throw new Exception("invalid userdata for StaticPusherStructA");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for StaticPusherStructA ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int StaticPusherStructB_TypeID = -1;
        public void PushStaticPusherStructB(RealStatePtr L, StaticPusherStructB val)
        {
            if (StaticPusherStructB_TypeID == -1)
            {
			    bool is_first;
                StaticPusherStructB_TypeID = getTypeId(L, typeof(StaticPusherStructB), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 12, StaticPusherStructB_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for StaticPusherStructB ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out StaticPusherStructB val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != StaticPusherStructB_TypeID)
				{
				    throw new Exception("invalid userdata for StaticPusherStructB");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for StaticPusherStructB");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (StaticPusherStructB)objectCasters.GetCaster(typeof(StaticPusherStructB))(L, index, null);
            }
        }
		
        public void UpdateStaticPusherStructB(RealStatePtr L, int index, StaticPusherStructB val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != StaticPusherStructB_TypeID)
				{
				    throw new Exception("invalid userdata for StaticPusherStructB");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for StaticPusherStructB ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int StaticPusherStructAll_TypeID = -1;
        public void PushStaticPusherStructAll(RealStatePtr L, StaticPusherStructAll val)
        {
            if (StaticPusherStructAll_TypeID == -1)
            {
			    bool is_first;
                StaticPusherStructAll_TypeID = getTypeId(L, typeof(StaticPusherStructAll), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 42, StaticPusherStructAll_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for StaticPusherStructAll ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out StaticPusherStructAll val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != StaticPusherStructAll_TypeID)
				{
				    throw new Exception("invalid userdata for StaticPusherStructAll");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for StaticPusherStructAll");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (StaticPusherStructAll)objectCasters.GetCaster(typeof(StaticPusherStructAll))(L, index, null);
            }
        }
		
        public void UpdateStaticPusherStructAll(RealStatePtr L, int index, StaticPusherStructAll val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != StaticPusherStructAll_TypeID)
				{
				    throw new Exception("invalid userdata for StaticPusherStructAll");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for StaticPusherStructAll ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int Gen2FloatStruct_TypeID = -1;
        public void PushGen2FloatStruct(RealStatePtr L, Gen2FloatStruct val)
        {
            if (Gen2FloatStruct_TypeID == -1)
            {
			    bool is_first;
                Gen2FloatStruct_TypeID = getTypeId(L, typeof(Gen2FloatStruct), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 8, Gen2FloatStruct_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for Gen2FloatStruct ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out Gen2FloatStruct val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != Gen2FloatStruct_TypeID)
				{
				    throw new Exception("invalid userdata for Gen2FloatStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for Gen2FloatStruct");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (Gen2FloatStruct)objectCasters.GetCaster(typeof(Gen2FloatStruct))(L, index, null);
            }
        }
		
        public void UpdateGen2FloatStruct(RealStatePtr L, int index, Gen2FloatStruct val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != Gen2FloatStruct_TypeID)
				{
				    throw new Exception("invalid userdata for Gen2FloatStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for Gen2FloatStruct ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int Gen3FloatStruct_TypeID = -1;
        public void PushGen3FloatStruct(RealStatePtr L, Gen3FloatStruct val)
        {
            if (Gen3FloatStruct_TypeID == -1)
            {
			    bool is_first;
                Gen3FloatStruct_TypeID = getTypeId(L, typeof(Gen3FloatStruct), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 12, Gen3FloatStruct_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for Gen3FloatStruct ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out Gen3FloatStruct val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != Gen3FloatStruct_TypeID)
				{
				    throw new Exception("invalid userdata for Gen3FloatStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for Gen3FloatStruct");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (Gen3FloatStruct)objectCasters.GetCaster(typeof(Gen3FloatStruct))(L, index, null);
            }
        }
		
        public void UpdateGen3FloatStruct(RealStatePtr L, int index, Gen3FloatStruct val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != Gen3FloatStruct_TypeID)
				{
				    throw new Exception("invalid userdata for Gen3FloatStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for Gen3FloatStruct ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int Gen4FloatStruct_TypeID = -1;
        public void PushGen4FloatStruct(RealStatePtr L, Gen4FloatStruct val)
        {
            if (Gen4FloatStruct_TypeID == -1)
            {
			    bool is_first;
                Gen4FloatStruct_TypeID = getTypeId(L, typeof(Gen4FloatStruct), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, Gen4FloatStruct_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for Gen4FloatStruct ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out Gen4FloatStruct val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != Gen4FloatStruct_TypeID)
				{
				    throw new Exception("invalid userdata for Gen4FloatStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for Gen4FloatStruct");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (Gen4FloatStruct)objectCasters.GetCaster(typeof(Gen4FloatStruct))(L, index, null);
            }
        }
		
        public void UpdateGen4FloatStruct(RealStatePtr L, int index, Gen4FloatStruct val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != Gen4FloatStruct_TypeID)
				{
				    throw new Exception("invalid userdata for Gen4FloatStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for Gen4FloatStruct ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int Gen5FloatStruct_TypeID = -1;
        public void PushGen5FloatStruct(RealStatePtr L, Gen5FloatStruct val)
        {
            if (Gen5FloatStruct_TypeID == -1)
            {
			    bool is_first;
                Gen5FloatStruct_TypeID = getTypeId(L, typeof(Gen5FloatStruct), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 20, Gen5FloatStruct_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for Gen5FloatStruct ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out Gen5FloatStruct val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != Gen5FloatStruct_TypeID)
				{
				    throw new Exception("invalid userdata for Gen5FloatStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for Gen5FloatStruct");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (Gen5FloatStruct)objectCasters.GetCaster(typeof(Gen5FloatStruct))(L, index, null);
            }
        }
		
        public void UpdateGen5FloatStruct(RealStatePtr L, int index, Gen5FloatStruct val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != Gen5FloatStruct_TypeID)
				{
				    throw new Exception("invalid userdata for Gen5FloatStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for Gen5FloatStruct ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int Gen6FloatStruct_TypeID = -1;
        public void PushGen6FloatStruct(RealStatePtr L, Gen6FloatStruct val)
        {
            if (Gen6FloatStruct_TypeID == -1)
            {
			    bool is_first;
                Gen6FloatStruct_TypeID = getTypeId(L, typeof(Gen6FloatStruct), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 24, Gen6FloatStruct_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for Gen6FloatStruct ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out Gen6FloatStruct val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != Gen6FloatStruct_TypeID)
				{
				    throw new Exception("invalid userdata for Gen6FloatStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for Gen6FloatStruct");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (Gen6FloatStruct)objectCasters.GetCaster(typeof(Gen6FloatStruct))(L, index, null);
            }
        }
		
        public void UpdateGen6FloatStruct(RealStatePtr L, int index, Gen6FloatStruct val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != Gen6FloatStruct_TypeID)
				{
				    throw new Exception("invalid userdata for Gen6FloatStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for Gen6FloatStruct ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int TableAutoTransSimpleStruct_TypeID = -1;
        public void PushTableAutoTransSimpleStruct(RealStatePtr L, TableAutoTransSimpleStruct val)
        {
            if (TableAutoTransSimpleStruct_TypeID == -1)
            {
			    bool is_first;
                TableAutoTransSimpleStruct_TypeID = getTypeId(L, typeof(TableAutoTransSimpleStruct), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 1, TableAutoTransSimpleStruct_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for TableAutoTransSimpleStruct ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out TableAutoTransSimpleStruct val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != TableAutoTransSimpleStruct_TypeID)
				{
				    throw new Exception("invalid userdata for TableAutoTransSimpleStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for TableAutoTransSimpleStruct");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (TableAutoTransSimpleStruct)objectCasters.GetCaster(typeof(TableAutoTransSimpleStruct))(L, index, null);
            }
        }
		
        public void UpdateTableAutoTransSimpleStruct(RealStatePtr L, int index, TableAutoTransSimpleStruct val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != TableAutoTransSimpleStruct_TypeID)
				{
				    throw new Exception("invalid userdata for TableAutoTransSimpleStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for TableAutoTransSimpleStruct ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int TableAutoTransComplexStruct_TypeID = -1;
        public void PushTableAutoTransComplexStruct(RealStatePtr L, TableAutoTransComplexStruct val)
        {
            if (TableAutoTransComplexStruct_TypeID == -1)
            {
			    bool is_first;
                TableAutoTransComplexStruct_TypeID = getTypeId(L, typeof(TableAutoTransComplexStruct), out is_first);
				
            }
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 25, TableAutoTransComplexStruct_TypeID);
            if (!CopyByValue.Pack(buff, 0, val))
            {
                throw new Exception("pack fail fail for TableAutoTransComplexStruct ,value="+val);
            }
			
        }
		
        public void Get(RealStatePtr L, int index, out TableAutoTransComplexStruct val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != TableAutoTransComplexStruct_TypeID)
				{
				    throw new Exception("invalid userdata for TableAutoTransComplexStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val))
                {
                    throw new Exception("unpack fail for TableAutoTransComplexStruct");
                }
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    CopyByValue.UnPack(this, L, index, out val);
			}
            else
            {
                val = (TableAutoTransComplexStruct)objectCasters.GetCaster(typeof(TableAutoTransComplexStruct))(L, index, null);
            }
        }
		
        public void UpdateTableAutoTransComplexStruct(RealStatePtr L, int index, TableAutoTransComplexStruct val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != TableAutoTransComplexStruct_TypeID)
				{
				    throw new Exception("invalid userdata for TableAutoTransComplexStruct");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  val))
                {
                    throw new Exception("pack fail for TableAutoTransComplexStruct ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int XLuaTestMyEnum_TypeID = -1;
		int XLuaTestMyEnum_EnumRef = -1;
        
        public void PushXLuaTestMyEnum(RealStatePtr L, XLuaTest.MyEnum val)
        {
            if (XLuaTestMyEnum_TypeID == -1)
            {
			    bool is_first;
                XLuaTestMyEnum_TypeID = getTypeId(L, typeof(XLuaTest.MyEnum), out is_first);
				
				if (XLuaTestMyEnum_EnumRef == -1)
				{
				    Utils.LoadCSTable(L, typeof(XLuaTest.MyEnum));
				    XLuaTestMyEnum_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX);
				}
				
            }
			
			if (LuaAPI.xlua_tryget_cachedud(L, (int)val, XLuaTestMyEnum_EnumRef) == 1)
            {
			    return;
			}
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, XLuaTestMyEnum_TypeID);
            if (!CopyByValue.Pack(buff, 0, (int)val))
            {
                throw new Exception("pack fail fail for XLuaTest.MyEnum ,value="+val);
            }
			
			LuaAPI.lua_getref(L, XLuaTestMyEnum_EnumRef);
			LuaAPI.lua_pushvalue(L, -2);
			LuaAPI.xlua_rawseti(L, -2, (int)val);
			LuaAPI.lua_pop(L, 1);
			
        }
		
        public void Get(RealStatePtr L, int index, out XLuaTest.MyEnum val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != XLuaTestMyEnum_TypeID)
				{
				    throw new Exception("invalid userdata for XLuaTest.MyEnum");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
				int e;
                if (!CopyByValue.UnPack(buff, 0, out e))
                {
                    throw new Exception("unpack fail for XLuaTest.MyEnum");
                }
				val = (XLuaTest.MyEnum)e;
                
            }
            else
            {
                val = (XLuaTest.MyEnum)objectCasters.GetCaster(typeof(XLuaTest.MyEnum))(L, index, null);
            }
        }
		
        public void UpdateXLuaTestMyEnum(RealStatePtr L, int index, XLuaTest.MyEnum val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != XLuaTestMyEnum_TypeID)
				{
				    throw new Exception("invalid userdata for XLuaTest.MyEnum");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  (int)val))
                {
                    throw new Exception("pack fail for XLuaTest.MyEnum ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int TutorialTestEnum_TypeID = -1;
		int TutorialTestEnum_EnumRef = -1;
        
        public void PushTutorialTestEnum(RealStatePtr L, Tutorial.TestEnum val)
        {
            if (TutorialTestEnum_TypeID == -1)
            {
			    bool is_first;
                TutorialTestEnum_TypeID = getTypeId(L, typeof(Tutorial.TestEnum), out is_first);
				
				if (TutorialTestEnum_EnumRef == -1)
				{
				    Utils.LoadCSTable(L, typeof(Tutorial.TestEnum));
				    TutorialTestEnum_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX);
				}
				
            }
			
			if (LuaAPI.xlua_tryget_cachedud(L, (int)val, TutorialTestEnum_EnumRef) == 1)
            {
			    return;
			}
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, TutorialTestEnum_TypeID);
            if (!CopyByValue.Pack(buff, 0, (int)val))
            {
                throw new Exception("pack fail fail for Tutorial.TestEnum ,value="+val);
            }
			
			LuaAPI.lua_getref(L, TutorialTestEnum_EnumRef);
			LuaAPI.lua_pushvalue(L, -2);
			LuaAPI.xlua_rawseti(L, -2, (int)val);
			LuaAPI.lua_pop(L, 1);
			
        }
		
        public void Get(RealStatePtr L, int index, out Tutorial.TestEnum val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != TutorialTestEnum_TypeID)
				{
				    throw new Exception("invalid userdata for Tutorial.TestEnum");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
				int e;
                if (!CopyByValue.UnPack(buff, 0, out e))
                {
                    throw new Exception("unpack fail for Tutorial.TestEnum");
                }
				val = (Tutorial.TestEnum)e;
                
            }
            else
            {
                val = (Tutorial.TestEnum)objectCasters.GetCaster(typeof(Tutorial.TestEnum))(L, index, null);
            }
        }
		
        public void UpdateTutorialTestEnum(RealStatePtr L, int index, Tutorial.TestEnum val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != TutorialTestEnum_TypeID)
				{
				    throw new Exception("invalid userdata for Tutorial.TestEnum");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  (int)val))
                {
                    throw new Exception("pack fail for Tutorial.TestEnum ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int TutorialDrivenClassTestEnumInner_TypeID = -1;
		int TutorialDrivenClassTestEnumInner_EnumRef = -1;
        
        public void PushTutorialDrivenClassTestEnumInner(RealStatePtr L, Tutorial.DrivenClass.TestEnumInner val)
        {
            if (TutorialDrivenClassTestEnumInner_TypeID == -1)
            {
			    bool is_first;
                TutorialDrivenClassTestEnumInner_TypeID = getTypeId(L, typeof(Tutorial.DrivenClass.TestEnumInner), out is_first);
				
				if (TutorialDrivenClassTestEnumInner_EnumRef == -1)
				{
				    Utils.LoadCSTable(L, typeof(Tutorial.DrivenClass.TestEnumInner));
				    TutorialDrivenClassTestEnumInner_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX);
				}
				
            }
			
			if (LuaAPI.xlua_tryget_cachedud(L, (int)val, TutorialDrivenClassTestEnumInner_EnumRef) == 1)
            {
			    return;
			}
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, TutorialDrivenClassTestEnumInner_TypeID);
            if (!CopyByValue.Pack(buff, 0, (int)val))
            {
                throw new Exception("pack fail fail for Tutorial.DrivenClass.TestEnumInner ,value="+val);
            }
			
			LuaAPI.lua_getref(L, TutorialDrivenClassTestEnumInner_EnumRef);
			LuaAPI.lua_pushvalue(L, -2);
			LuaAPI.xlua_rawseti(L, -2, (int)val);
			LuaAPI.lua_pop(L, 1);
			
        }
		
        public void Get(RealStatePtr L, int index, out Tutorial.DrivenClass.TestEnumInner val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != TutorialDrivenClassTestEnumInner_TypeID)
				{
				    throw new Exception("invalid userdata for Tutorial.DrivenClass.TestEnumInner");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
				int e;
                if (!CopyByValue.UnPack(buff, 0, out e))
                {
                    throw new Exception("unpack fail for Tutorial.DrivenClass.TestEnumInner");
                }
				val = (Tutorial.DrivenClass.TestEnumInner)e;
                
            }
            else
            {
                val = (Tutorial.DrivenClass.TestEnumInner)objectCasters.GetCaster(typeof(Tutorial.DrivenClass.TestEnumInner))(L, index, null);
            }
        }
		
        public void UpdateTutorialDrivenClassTestEnumInner(RealStatePtr L, int index, Tutorial.DrivenClass.TestEnumInner val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != TutorialDrivenClassTestEnumInner_TypeID)
				{
				    throw new Exception("invalid userdata for Tutorial.DrivenClass.TestEnumInner");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  (int)val))
                {
                    throw new Exception("pack fail for Tutorial.DrivenClass.TestEnumInner ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int LuaTestType_TypeID = -1;
		int LuaTestType_EnumRef = -1;
        
        public void PushLuaTestType(RealStatePtr L, LuaTestType val)
        {
            if (LuaTestType_TypeID == -1)
            {
			    bool is_first;
                LuaTestType_TypeID = getTypeId(L, typeof(LuaTestType), out is_first);
				
				if (LuaTestType_EnumRef == -1)
				{
				    Utils.LoadCSTable(L, typeof(LuaTestType));
				    LuaTestType_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX);
				}
				
            }
			
			if (LuaAPI.xlua_tryget_cachedud(L, (int)val, LuaTestType_EnumRef) == 1)
            {
			    return;
			}
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, LuaTestType_TypeID);
            if (!CopyByValue.Pack(buff, 0, (int)val))
            {
                throw new Exception("pack fail fail for LuaTestType ,value="+val);
            }
			
			LuaAPI.lua_getref(L, LuaTestType_EnumRef);
			LuaAPI.lua_pushvalue(L, -2);
			LuaAPI.xlua_rawseti(L, -2, (int)val);
			LuaAPI.lua_pop(L, 1);
			
        }
		
        public void Get(RealStatePtr L, int index, out LuaTestType val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != LuaTestType_TypeID)
				{
				    throw new Exception("invalid userdata for LuaTestType");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
				int e;
                if (!CopyByValue.UnPack(buff, 0, out e))
                {
                    throw new Exception("unpack fail for LuaTestType");
                }
				val = (LuaTestType)e;
                
            }
            else
            {
                val = (LuaTestType)objectCasters.GetCaster(typeof(LuaTestType))(L, index, null);
            }
        }
		
        public void UpdateLuaTestType(RealStatePtr L, int index, LuaTestType val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != LuaTestType_TypeID)
				{
				    throw new Exception("invalid userdata for LuaTestType");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  (int)val))
                {
                    throw new Exception("pack fail for LuaTestType ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        int FirstPushEnum_TypeID = -1;
		int FirstPushEnum_EnumRef = -1;
        
        public void PushFirstPushEnum(RealStatePtr L, FirstPushEnum val)
        {
            if (FirstPushEnum_TypeID == -1)
            {
			    bool is_first;
                FirstPushEnum_TypeID = getTypeId(L, typeof(FirstPushEnum), out is_first);
				
				if (FirstPushEnum_EnumRef == -1)
				{
				    Utils.LoadCSTable(L, typeof(FirstPushEnum));
				    FirstPushEnum_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX);
				}
				
            }
			
			if (LuaAPI.xlua_tryget_cachedud(L, (int)val, FirstPushEnum_EnumRef) == 1)
            {
			    return;
			}
			
            IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, FirstPushEnum_TypeID);
            if (!CopyByValue.Pack(buff, 0, (int)val))
            {
                throw new Exception("pack fail fail for FirstPushEnum ,value="+val);
            }
			
			LuaAPI.lua_getref(L, FirstPushEnum_EnumRef);
			LuaAPI.lua_pushvalue(L, -2);
			LuaAPI.xlua_rawseti(L, -2, (int)val);
			LuaAPI.lua_pop(L, 1);
			
        }
		
        public void Get(RealStatePtr L, int index, out FirstPushEnum val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != FirstPushEnum_TypeID)
				{
				    throw new Exception("invalid userdata for FirstPushEnum");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
				int e;
                if (!CopyByValue.UnPack(buff, 0, out e))
                {
                    throw new Exception("unpack fail for FirstPushEnum");
                }
				val = (FirstPushEnum)e;
                
            }
            else
            {
                val = (FirstPushEnum)objectCasters.GetCaster(typeof(FirstPushEnum))(L, index, null);
            }
        }
		
        public void UpdateFirstPushEnum(RealStatePtr L, int index, FirstPushEnum val)
        {
            if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA)
            {
			    if (LuaAPI.xlua_gettypeid(L, index) != FirstPushEnum_TypeID)
				{
				    throw new Exception("invalid userdata for FirstPushEnum");
				}
				
                IntPtr buff = LuaAPI.lua_touserdata(L, index);
                if (!CopyByValue.Pack(buff, 0,  (int)val))
                {
                    throw new Exception("pack fail for FirstPushEnum ,value="+val);
                }
            }
            else
            {
                throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index));
            }
        }
        
        
		// table cast optimze
		
		public void Get(RealStatePtr L, int index, out TableAutoTransSimpleClass val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    val = (TableAutoTransSimpleClass)FastGetCSObj(L, index);
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    val = new TableAutoTransSimpleClass();
				int top = LuaAPI.lua_gettop(L);
				
				if (Utils.LoadField(L, index, "x"))
				{
					Get(L, top + 1, out val.x);
				}
				LuaAPI.lua_pop(L, 1);
				
				if (Utils.LoadField(L, index, "y"))
				{
					Get(L, top + 1, out val.y);
				}
				LuaAPI.lua_pop(L, 1);
				
				if (Utils.LoadField(L, index, "z"))
				{
					Get(L, top + 1, out val.z);
				}
				LuaAPI.lua_pop(L, 1);
				
			}
            else
            {
                val = (TableAutoTransSimpleClass)objectCasters.GetCaster(typeof(TableAutoTransSimpleClass))(L, index, null);
            }
        }
		
		public void Get(RealStatePtr L, int index, out TableAutoTransComplexClass val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    val = (TableAutoTransComplexClass)FastGetCSObj(L, index);
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    val = new TableAutoTransComplexClass();
				int top = LuaAPI.lua_gettop(L);
				
				if (Utils.LoadField(L, index, "A"))
				{
					Get(L, top + 1, out val.A);
				}
				LuaAPI.lua_pop(L, 1);
				
				if (Utils.LoadField(L, index, "B"))
				{
					Get(L, top + 1, out val.B);
				}
				LuaAPI.lua_pop(L, 1);
				
			}
            else
            {
                val = (TableAutoTransComplexClass)objectCasters.GetCaster(typeof(TableAutoTransComplexClass))(L, index, null);
            }
        }
		
		public void Get(RealStatePtr L, int index, out TestTableAutoTransClass val)
        {
		    LuaTypes type = LuaAPI.lua_type(L, index);
            if (type == LuaTypes.LUA_TUSERDATA )
            {
			    val = (TestTableAutoTransClass)FastGetCSObj(L, index);
            }
			else if (type ==LuaTypes.LUA_TTABLE)
			{
			    val = new TestTableAutoTransClass();
				int top = LuaAPI.lua_gettop(L);
				
			}
            else
            {
                val = (TestTableAutoTransClass)objectCasters.GetCaster(typeof(TestTableAutoTransClass))(L, index, null);
            }
        }
		
        
    }
	
	public partial class StaticLuaCallbacks
    {
	    static bool __tryArrayGet(Type type, RealStatePtr L, ObjectTranslator translator, object obj, int index)
		{
		
			if (type == typeof(XLuaTest.Pedding[]))
			{
			    XLuaTest.Pedding[] array = obj as XLuaTest.Pedding[];
				translator.PushXLuaTestPedding(L, array[index]);
				return true;
			}
			else if (type == typeof(XLuaTest.MyStruct[]))
			{
			    XLuaTest.MyStruct[] array = obj as XLuaTest.MyStruct[];
				translator.PushXLuaTestMyStruct(L, array[index]);
				return true;
			}
			else if (type == typeof(UnityEngine.Vector2[]))
			{
			    UnityEngine.Vector2[] array = obj as UnityEngine.Vector2[];
				translator.PushUnityEngineVector2(L, array[index]);
				return true;
			}
			else if (type == typeof(UnityEngine.Vector3[]))
			{
			    UnityEngine.Vector3[] array = obj as UnityEngine.Vector3[];
				translator.PushUnityEngineVector3(L, array[index]);
				return true;
			}
			else if (type == typeof(UnityEngine.Vector4[]))
			{
			    UnityEngine.Vector4[] array = obj as UnityEngine.Vector4[];
				translator.PushUnityEngineVector4(L, array[index]);
				return true;
			}
			else if (type == typeof(UnityEngine.Color[]))
			{
			    UnityEngine.Color[] array = obj as UnityEngine.Color[];
				translator.PushUnityEngineColor(L, array[index]);
				return true;
			}
			else if (type == typeof(UnityEngine.Quaternion[]))
			{
			    UnityEngine.Quaternion[] array = obj as UnityEngine.Quaternion[];
				translator.PushUnityEngineQuaternion(L, array[index]);
				return true;
			}
			else if (type == typeof(UnityEngine.Ray[]))
			{
			    UnityEngine.Ray[] array = obj as UnityEngine.Ray[];
				translator.PushUnityEngineRay(L, array[index]);
				return true;
			}
			else if (type == typeof(UnityEngine.Bounds[]))
			{
			    UnityEngine.Bounds[] array = obj as UnityEngine.Bounds[];
				translator.PushUnityEngineBounds(L, array[index]);
				return true;
			}
			else if (type == typeof(UnityEngine.Ray2D[]))
			{
			    UnityEngine.Ray2D[] array = obj as UnityEngine.Ray2D[];
				translator.PushUnityEngineRay2D(L, array[index]);
				return true;
			}
			else if (type == typeof(TestStruct[]))
			{
			    TestStruct[] array = obj as TestStruct[];
				translator.PushTestStruct(L, array[index]);
				return true;
			}
			else if (type == typeof(StaticPusherStructA[]))
			{
			    StaticPusherStructA[] array = obj as StaticPusherStructA[];
				translator.PushStaticPusherStructA(L, array[index]);
				return true;
			}
			else if (type == typeof(StaticPusherStructB[]))
			{
			    StaticPusherStructB[] array = obj as StaticPusherStructB[];
				translator.PushStaticPusherStructB(L, array[index]);
				return true;
			}
			else if (type == typeof(StaticPusherStructAll[]))
			{
			    StaticPusherStructAll[] array = obj as StaticPusherStructAll[];
				translator.PushStaticPusherStructAll(L, array[index]);
				return true;
			}
			else if (type == typeof(Gen2FloatStruct[]))
			{
			    Gen2FloatStruct[] array = obj as Gen2FloatStruct[];
				translator.PushGen2FloatStruct(L, array[index]);
				return true;
			}
			else if (type == typeof(Gen3FloatStruct[]))
			{
			    Gen3FloatStruct[] array = obj as Gen3FloatStruct[];
				translator.PushGen3FloatStruct(L, array[index]);
				return true;
			}
			else if (type == typeof(Gen4FloatStruct[]))
			{
			    Gen4FloatStruct[] array = obj as Gen4FloatStruct[];
				translator.PushGen4FloatStruct(L, array[index]);
				return true;
			}
			else if (type == typeof(Gen5FloatStruct[]))
			{
			    Gen5FloatStruct[] array = obj as Gen5FloatStruct[];
				translator.PushGen5FloatStruct(L, array[index]);
				return true;
			}
			else if (type == typeof(Gen6FloatStruct[]))
			{
			    Gen6FloatStruct[] array = obj as Gen6FloatStruct[];
				translator.PushGen6FloatStruct(L, array[index]);
				return true;
			}
			else if (type == typeof(TableAutoTransSimpleStruct[]))
			{
			    TableAutoTransSimpleStruct[] array = obj as TableAutoTransSimpleStruct[];
				translator.PushTableAutoTransSimpleStruct(L, array[index]);
				return true;
			}
			else if (type == typeof(TableAutoTransComplexStruct[]))
			{
			    TableAutoTransComplexStruct[] array = obj as TableAutoTransComplexStruct[];
				translator.PushTableAutoTransComplexStruct(L, array[index]);
				return true;
			}
			else if (type == typeof(XLuaTest.MyEnum[]))
			{
			    XLuaTest.MyEnum[] array = obj as XLuaTest.MyEnum[];
				translator.PushXLuaTestMyEnum(L, array[index]);
				return true;
			}
			else if (type == typeof(Tutorial.TestEnum[]))
			{
			    Tutorial.TestEnum[] array = obj as Tutorial.TestEnum[];
				translator.PushTutorialTestEnum(L, array[index]);
				return true;
			}
			else if (type == typeof(Tutorial.DrivenClass.TestEnumInner[]))
			{
			    Tutorial.DrivenClass.TestEnumInner[] array = obj as Tutorial.DrivenClass.TestEnumInner[];
				translator.PushTutorialDrivenClassTestEnumInner(L, array[index]);
				return true;
			}
			else if (type == typeof(LuaTestType[]))
			{
			    LuaTestType[] array = obj as LuaTestType[];
				translator.PushLuaTestType(L, array[index]);
				return true;
			}
			else if (type == typeof(FirstPushEnum[]))
			{
			    FirstPushEnum[] array = obj as FirstPushEnum[];
				translator.PushFirstPushEnum(L, array[index]);
				return true;
			}
            return false;
		}
		
		static bool __tryArraySet(Type type, RealStatePtr L, ObjectTranslator translator, object obj, int array_idx, int obj_idx)
		{
		
			if (type == typeof(XLuaTest.Pedding[]))
			{
			    XLuaTest.Pedding[] array = obj as XLuaTest.Pedding[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(XLuaTest.MyStruct[]))
			{
			    XLuaTest.MyStruct[] array = obj as XLuaTest.MyStruct[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(UnityEngine.Vector2[]))
			{
			    UnityEngine.Vector2[] array = obj as UnityEngine.Vector2[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(UnityEngine.Vector3[]))
			{
			    UnityEngine.Vector3[] array = obj as UnityEngine.Vector3[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(UnityEngine.Vector4[]))
			{
			    UnityEngine.Vector4[] array = obj as UnityEngine.Vector4[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(UnityEngine.Color[]))
			{
			    UnityEngine.Color[] array = obj as UnityEngine.Color[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(UnityEngine.Quaternion[]))
			{
			    UnityEngine.Quaternion[] array = obj as UnityEngine.Quaternion[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(UnityEngine.Ray[]))
			{
			    UnityEngine.Ray[] array = obj as UnityEngine.Ray[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(UnityEngine.Bounds[]))
			{
			    UnityEngine.Bounds[] array = obj as UnityEngine.Bounds[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(UnityEngine.Ray2D[]))
			{
			    UnityEngine.Ray2D[] array = obj as UnityEngine.Ray2D[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(TestStruct[]))
			{
			    TestStruct[] array = obj as TestStruct[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(StaticPusherStructA[]))
			{
			    StaticPusherStructA[] array = obj as StaticPusherStructA[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(StaticPusherStructB[]))
			{
			    StaticPusherStructB[] array = obj as StaticPusherStructB[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(StaticPusherStructAll[]))
			{
			    StaticPusherStructAll[] array = obj as StaticPusherStructAll[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(Gen2FloatStruct[]))
			{
			    Gen2FloatStruct[] array = obj as Gen2FloatStruct[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(Gen3FloatStruct[]))
			{
			    Gen3FloatStruct[] array = obj as Gen3FloatStruct[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(Gen4FloatStruct[]))
			{
			    Gen4FloatStruct[] array = obj as Gen4FloatStruct[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(Gen5FloatStruct[]))
			{
			    Gen5FloatStruct[] array = obj as Gen5FloatStruct[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(Gen6FloatStruct[]))
			{
			    Gen6FloatStruct[] array = obj as Gen6FloatStruct[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(TableAutoTransSimpleStruct[]))
			{
			    TableAutoTransSimpleStruct[] array = obj as TableAutoTransSimpleStruct[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(TableAutoTransComplexStruct[]))
			{
			    TableAutoTransComplexStruct[] array = obj as TableAutoTransComplexStruct[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(XLuaTest.MyEnum[]))
			{
			    XLuaTest.MyEnum[] array = obj as XLuaTest.MyEnum[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(Tutorial.TestEnum[]))
			{
			    Tutorial.TestEnum[] array = obj as Tutorial.TestEnum[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(Tutorial.DrivenClass.TestEnumInner[]))
			{
			    Tutorial.DrivenClass.TestEnumInner[] array = obj as Tutorial.DrivenClass.TestEnumInner[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(LuaTestType[]))
			{
			    LuaTestType[] array = obj as LuaTestType[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(FirstPushEnum[]))
			{
			    FirstPushEnum[] array = obj as FirstPushEnum[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(TableAutoTransSimpleClass[]))
			{
			    TableAutoTransSimpleClass[] array = obj as TableAutoTransSimpleClass[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(TableAutoTransComplexClass[]))
			{
			    TableAutoTransComplexClass[] array = obj as TableAutoTransComplexClass[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
			else if (type == typeof(TestTableAutoTransClass[]))
			{
			    TestTableAutoTransClass[] array = obj as TestTableAutoTransClass[];
				translator.Get(L, obj_idx, out array[array_idx]);
				return true;
			}
            return false;
		}
		
		static StaticLuaCallbacks()
        {
            genTryArrayGetPtr = __tryArrayGet;
            GenTryArraySetPtr = __tryArraySet;
        }
	}
}